package cn.edu.stu.interception;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;

/**
 * @author Karl
 * @Date 2022/12/22 - 11:10
 */
public class PrintRequestInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("myLog: "+new Date(System.currentTimeMillis())+ request.getServletPath());

        return true;
    }
}
